package com.itheima.day11;

import java.util.Random;

public class Test8 {
    public static void main(String[] args) {
        int[] arr = new int[30];
        int sum = 0;
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100) + 1;
            if(arr[i] >= 5){
                sum += i;
            }
        }System.out.println("今日小明偷走好友" +sum+ "的能量");

    }
}
